<?php
/**
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       Cake.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
$cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework');
?>
<!DOCTYPE html>
<html>
    <head>
        <?php echo $this->Html->charset(); ?>

        <title>
            Transporte Villa -
            <?php echo $title_for_layout; ?>
        </title>


        <?php
        echo $this->Html->script(array(
            'jquery-1.9.1',
            'jquery-ui-1.10.1.custom.min',
            'jquery.numeric',
            'date',
            'suma',
            'flashMessages',
            'menu'
                )
        );
        ?>
        <?php
        echo $scripts_for_layout;

        echo $this->Html->meta('icon');

        echo $this->Html->css(array('style',
            'buttons', 'datepicker',
            'normalize', 'date', 'order',
            'imprimir',
            'menu'
//        'layout'
        ));

        echo $this->fetch('meta');
        echo $this->fetch('css');
        echo $this->fetch('script');
        ?>
    </head>
    <body>
        <div id="container">
            <div id="header">

                <a href="<?php echo $this->Html->url('/') ?>">
                    <h1> 

                        <?php echo ucwords($this->Session->read('Auth.User.social_razon')) ?>
                        <div class="logout">
                            <?php echo $this->Html->link('Salir', array('controller' => 'Users', 'action' => 'logout')) ?>
                        </div>
                    </h1>


                </a>

                <ul class="navigation">

                    <li><a href="#">Ordenes</a>
                        <ul>
                            <li><?php echo $this->Html->link(__('Nueva Orden'), array('controller' => 'orders', 'action' => 'add')); ?></li>
                            <li><?php echo $this->Html->link(__('Historico'), array('controller' => 'orders', 'action' => 'index')); ?></li>
                        </ul>
                        <div class="clear"></div>
                    </li>

                    <li><a href="#">Empresas</a>
                        <ul>
                            <li><?php echo $this->Html->link(__('Crear Empresa'), array('controller' => 'ClientCompanies', 'action' => 'add')); ?></li>
                            <li><?php echo $this->Html->link(__('Ver Empresas'), array('controller' => 'ClientCompanies', 'action' => 'index')); ?></li>
                        </ul>
                        <div class="clear"></div>
                    </li>

                    <li><a href="#">Transportes</a>
                        <ul>
                            <li><?php echo $this->Html->link(__('Crear Transporte'), array('controller' => 'Companies', 'action' => 'add')); ?></li>
                            <li><?php echo $this->Html->link(__('Ver Transportes'), array('controller' => 'Companies', 'action' => 'index')); ?></li>
                        </ul>
                        <div class="clear"></div>
                    </li>

          <li><a href="#">Choferes</a>
            <ul>
              <li><?php echo $this->Html->link(__('Agregar Chofer Solo'), array('controller' => 'Drivers', 'action' => 'add')); ?></li>
              <li><?php echo $this->Html->link(__('Agregar Chofer-Camion-Acoplado'), array('controller' => 'Drivers', 'action' => 'addAll')); ?></li>
              <li><?php echo $this->Html->link(__('Listado de Choferes'), array('controller' => 'Drivers', 'action' => 'index')); ?></li>
            </ul>
            <div class="clear"></div>
          </li>

          <li><a href="#">Camiones</a>
            <ul>
              <li><?php echo $this->Html->link(__('Agregar Camion'), array('controller' => 'Vehicles', 'action' => 'add')); ?></li>
              <li><?php echo $this->Html->link(__('Listado de Camiones'), array('controller' => 'Vehicles', 'action' => 'index')); ?></li>
            </ul>
            <div class="clear"></div>
          </li>

          <li><a href="#">Acoplados</a>
            <ul>
              <li><?php echo $this->Html->link(__('Agregar Acoplado'), array('controller' => 'Coupleds', 'action' => 'add')); ?></li>
              <li><?php echo $this->Html->link(__('Listado de Acoplados'), array('controller' => 'Coupleds', 'action' => 'index')); ?></li>
            </ul>
            <div class="clear"></div>
          </li>

          <li><a href="#">Productos</a>
            <ul>
              <li><?php echo $this->Html->link(__('Agregar Producto'), array('controller' => 'Products', 'action' => 'add')); ?></li>
              <li><?php echo $this->Html->link(__('Listado de Productos'), array('controller' => 'Products', 'action' => 'index')); ?></li>
            </ul>
            <div class="clear"></div>
          </li>

                    <?php if ($this->Session->read('Auth.User.role') === 'admin') : ?>

                        <li><a href="#">Usarios</a>
                            <ul>
                                <li><?php echo $this->Html->link(__('Listado'), array('controller' => 'users', 'action' => 'index')); ?> </li>
                                <li><?php echo $this->Html->link(__('Logs'), array('controller' => 'LogsUsers', 'action' => 'index')); ?> </li>
                            </ul>
                            <div class="clear"></div>
                        </li>

                    <?php endif; ?>



                </ul>
            </div>

            <div id="content">


                <?php echo $this->Session->flash(); ?>

                <?php echo $this->fetch('content'); ?>
            </div>
            <div id="footer">
                <?php
//                echo $this->Html->link(                      $this->Html->image('cake.power.gif', array('alt' => $cakeDescription, 'border' => '0')), 'http://www.cakephp.org/', array('target' => '_blank', 'escape' => false)                );
                ?>
            </div>
        </div>
        <?php echo $this->element('sql_dump'); ?>
    </body>
</html>
